﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Runtime.Remoting.Messaging;

using DAL;
using Model;

namespace BLL
{
    /// <summary>
    /// 待推送消息 業務類
    /// </summary>
    public class PendingpushmessageBLL : BaseBLL<Model.Pendingpushmessage>
    {
        /// <summary>
        /// 子类数据访问类对象
        /// </summary>
        PendingpushmessageDAL childDAL = null;
        #region 重写父类的抽象方法
        /// <summary>
        /// 重写父类的抽象方法
        /// </summary>
        protected override void SetDAL()
        {
            childDAL = new DAL.PendingpushmessageDAL();
            dal = new DAL.PendingpushmessageDAL();//为父类变量赋值
        }
        #endregion

        #region 當前類業務類對象
        /// <summary>
        /// 當前類業務類對象
        /// </summary>
        public static PendingpushmessageBLL CurrBll
        {
            get
            {
                PendingpushmessageBLL model = CallContext.GetData(typeof(PendingpushmessageBLL).Name) as PendingpushmessageBLL;
                if (model != null)
                {
                    return model;
                }
                else
                {
                    model = new PendingpushmessageBLL();
                    CallContext.SetData(typeof(PendingpushmessageBLL).Name, model);
                    return model;
                }
            }
        }

        /// <summary>
        /// 添加推送消息以及需要推送的設備
        /// </summary>
        public int AddList(int appId, string message, string data, string aztokenList,string iostokenList)
        {
            return childDAL.AddList(appId, message, data, aztokenList, iostokenList);
        }

        /// <summary>
        /// 獲取需要推送的消息以及設備
        /// </summary>
        public List<Pendingpushmessage> GetList()
        {
            return childDAL.GetList();
        }
        /// <summary>
        /// 獲取已推送的消息以及設備
        /// </summary>
        public List<Pendingpushmessage> GetListSent()
        {
            return childDAL.GetListSent();
        }
        #endregion
    }
}
